package dubbo.demo.consumer.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import dubbo.demo.api.IDemoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.Serializable;

@Api(value = "DemoController",tags = "dubbo-demo控制器")
@RestController
public class DemoController {

    @Reference(version = "1.0.0")
    private IDemoService demoService;

    @ApiOperation(value = "测试方法",tags = "dubbo-demo控制器")
    @GetMapping("/sayHello")
    public Serializable sayHello(){
        return demoService.sayHello();
    }
}